package com.cy.module.web;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@ControllerAdvice
@ResponseBody
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(ArithmeticException.class)
   // @ResponseBody
    public String doHandArithExe(ArithmeticException exception) {
        System.out.println("GlobalExceptionHandler");
        return "除数不能为0";
    }
}
